<html xmlns:color="http://www.w3.org/1999/xhtml" xmlns:padding-top="http://www.w3.org/1999/xhtml">
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="IE=edge">
    <title>检索管理</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <link rel="stylesheet" href="../static/plugins/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="../static/plugins/adminLTE/css/AdminLTE.css">
    <link rel="stylesheet" href="../static/plugins/adminLTE/css/skins/_all-skins.min.css">
    <link rel="stylesheet" href="../static/css/style.css">
    <link rel="stylesheet" href="../static/plugins/angularjs/toaster.min.css">
    <script src="../static/plugins/jQuery/jquery-2.2.3.min.js"></script>
    <script src="../static/plugins/bootstrap/js/bootstrap.min.js"></script>

    <script type="text/javascript" src="../static/plugins/angularjs/angular.min.js"></script>
    <script type="text/javascript" src="../static/plugins/angularjs/angular-animate.min.js"></script>
    <script type="text/javascript" src="../static/plugins/angularjs/toaster.min.js"></script>

    <style>
        .tab{
            margin-left:300px;
        }
        .box-body{
            text-align:left;
        }

    </style>
    <style type="text/css">
        .return {
            display: block;
            cursor: pointer;
            width: auto;
            height:12px;
            top: 60px;
            right: 30px;
            position: absolute;
        }
        .top{
            float: right;
            padding-right: 5px;
        }
    </style>
    <script type="text/javascript">
        var app = angular.module("drugsCatalog",[]);
        app.controller("drugCheckController",function ($scope,$http) {

            $scope.model = {
                "administrative": "",
                "followGrowp": "",
                "date": "",
                "patientNumber": "",
                "name": "",
                "sex":"",
                "age":"",
                "nextDate":"",
                "state":""
            };
            $scope.pages = function (pageNum,pageSize) {

                if (pageNum == null || pageNum == "") {
                    pageNum=$("#pagenum").val();
                }
                if (pageSize == null || pageSize==""){
                    var myselect=document.getElementById("pageSize");
                    var index = myselect.selectedIndex;
                    var optionsval = myselect.options[index].value;
                    pageSize=optionsval;
                }
                $scope.model.pageNum = pageNum;
                $scope.model.pageSize = pageSize;
                $http({
                    url: "selectDrugCatalog",
                    method: "post",
                    data: $scope.model,
                    dataType: "json",
                    headers: {'Content-Type': 'application/x-www-form-urlencoded'},
                    transformRequest: function (obj) { //在请求之前对data传参进行格式转换
                        var str = [];
                        for (var p in obj) {
                            str.push(p + "=" + obj[p]);
                        }
                        return str.join("&");
                    }
                }).success(function (data) {//请求成功并返回数据
                    $scope.pageUtil = data;
                })
            }
        });
        function fatherChecked() {
            //定义父选择器
            var father = $("[name=fathercheck]");
            //定义子选择器
            var children = $("[name=childrencheck]");
            //如果选中父选择器
            if(father.prop("checked")){
                //则子选择器全部循环遍历选中
                for (var i=0;i<children.length;i++){
                    //childre[i].checked = true;//js写法
                    //给子选择器选择属性赋值为true
                    $(children[i]).prop("checked",true);
                }
            }else{
                //否则未选中父选择器则遍历循环子选择器
                for(var i=0;i<children.length;i++){
                    //给子选择器选择属性赋值为false
                    $(children[i]).prop("checked",false);
                }
            }
        }

        function childrenChecked(){
            var father = $("[name=fathercheck]");
            var children = $("[name=childrencheck]");
            var bool = true;
            for(var i=0;i<children.length;i++){
                //如果子选择器没被选择 bool为false
                if(!children[i].checked){
                    bool=false;
                    break;
                }
            }
            father.prop("checked",bool);
        }
        function removeBeach() {
            var children = $("[name=childrencheck]");
            var array = new Array;
            var b = false;
            for (var i = 0;i < children.length;i++) {
                if (children[i].checked) {
                    b = true;
                    console.log($(children[i]).val());
                    array.push(children[i].value);
                }
            }
            if (b) {
                $.ajax({
                    url: "updateIsDel",
                    type: "post",
                    data: {
                        ids: array
                    },
                    dataType: "json",
                    success: function (data) {
                        if (data) {
                            alert("提交成功")
                            history.go();
                        } else alert("提交失败")
                    }
                })
            } else {
                alert("请选择要提交的数据")
            }
        }
        function exportCatalogAll() {
            window.location.href = "exportCatalogAll";
        }
    </script>
</head>
<body class="hold-transition skin-red sidebar-mini" ng-app="drugsCatalog" ng-controller="drugCheckController" ng-init="pages()">
<!-- .box-body -->
<toaster-container toaster-options="{'time-out': 1000,'position-class':'toast-top-center'}"></toaster-container>

<div class="box-header with-border" style="background-color: #00BFFF;color:#FFFFFF;width: 1470px">
    <h3 class="box-title">随访进度管理</h3>
    <div class="top">
        <h5 class="setting">
            <a href="" style="background-color: #00BFFF;color:#FFFFFF;">随访进度管理</a>
            <a href="" style="background-color: #00BFFF;color:#FFFFFF;">数据复核</a>
            <a href="" style="background-color: #00BFFF;color:#FFFFFF;">分组管理</a>
            <a href="" style="background-color: #00BFFF;color:#FFFFFF;">系统设置</a>
            <a href="" style="background-color: #00BFFF;color:#FFFFFF;">账号设置</a>
        </h5>
    </div>
</div>
<div class="box-body">
    <div class="has-feedback">
        <div style="text-align:center; vertical-align:middle;background: #ffff">
            <table class="tab">
                <tr class="col-md-12">
                    <td width="200px"><span >条件：</span></td>
                    <td style="padding-top: 10px;">
                        <select padding-center;  class="form-control">
                            <option value="1">姓名</option>
                            <option value="2">住院号</option>
                            <option value="3">白细胞</option>
                            <option value="4">血糖</option>
                            <option value="5">症状</option>
                            <option value="6">诊断</option>
                            <option value="7">手术名称</option>
                        </select>
                    </td>
                    <td style="padding-top: 10px;">
                        <select padding-center;  class="form-control">
                            <option value="8">等于</option>
                            <option value="9">小于</option>
                            <option value="10">大于</option>
                        </select>
                    </td>
                    <td style="padding-top: 10px;">
                        <input padding-center; >
                    <td style="text-align: center;padding-top: 8px;padding-left: 20px">
                        <button class="btn btn-default"ng-click="pages()" style="background-color: #00BFFF;color:#FFFFFF">-</button>
                    </td>
                    </td>
                </tr>
                <tr class="col-md-12">
                    <td style="padding-top: 10px;width: 200px" >
                        <select style="width: 150px" padding-center;  class="form-control">
                            <option value="29">并且</option>
                            <option value="30">或者</option>
                        </select>
                    </td>
                    <td  style="padding-top: 10px;">
                        <select padding-center;  class="form-control">
                            <option value="11">姓名</option>
                            <option value="12">住院号</option>
                            <option value="13">白细胞</option>
                            <option value="14">血糖</option>
                            <option value="15">症状</option>
                            <option value="16">诊断</option>
                            <option value="17">手术名称</option>
                        </select>
                    </td>
                    <td style="padding-top: 10px;">
                        <select padding-center;  class="form-control">
                            <option value="18">等于</option>
                            <option value="19">包含</option>
                        </select>
                    </td>
                    <td style="padding-top: 10px;">
                        <input padding-center;>
                    <td style="text-align: center;padding-top: 8px;padding-left: 20px">
                        <button class="btn btn-default"ng-click="pages()" style="background-color: #00BFFF;color:#FFFFFF">-</button>
                    </td>
                    </td>
                </tr>
                <tr class="col-md-12">
                    <td style="padding-top: 10px;width: 200px">
                        <select style="width: 150px" padding-center;  class="form-control">
                            <option value="31">并且</option>
                            <option value="32">或者</option>
                        </select>
                    </td>
                    <td  style="padding-top: 10px;">
                        <select padding-center;  class="form-control">
                            <option value="20">姓名</option>
                            <option value="21">住院号</option>
                            <option value="22">白细胞</option>
                            <option value="23">血糖</option>
                            <option value="24">症状</option>
                            <option value="25">诊断</option>
                            <option value="26">手术名称</option>
                        </select>
                    </td>
                    <td style="padding-top: 10px;">
                        <select padding-center; class="form-control">
                            <option value="27">等于</option>
                            <option value="28">包含</option>
                        </select>
                    </td>
                    <td style="padding-top: 10px;">
                        <input padding-center;>
                    <td style="text-align: center;padding-top: 8px;padding-left: 20px">
                        <button class="btn btn-default"ng-click="pages()" style="background-color: #00BFFF;color:#FFFFFF">-</button>
                    </td>
                    </td>
                </tr>
                <tr class="col-md-12">
                    <td width="200px"><span >结果：</span></td>
                    <td style="padding-top: 10px;">
                        <select style="width: 300px" class="form-control">
                            <option value="33">手术术式信息</option>
                            <option value="34">检查报告信息</option>
                            <option value="35">并发症名称</option>
                        </select>
                            <td style="text-align: center;padding-top: 8px;padding-left: 20px">
                                <button class="btn btn-default"ng-click="pages()" style="background-color: #00BFFF;color:#FFFFFF">查询</button>
                            </td><td style="text-align: center;padding-top: 8px;padding-left: 20px">
                                <button class="btn btn-default"ng-click="pages()" style="background-color: #00BFFF;color:#FFFFFF">添加条件</button>
                            </td>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="box-body">
        <!-- 数据表格 -->
        <div class="table-box">
            <!-- 数据表格 -->
            <div class="table-box">
                <!--工具栏-->
                <div class="pull-left">
                    <div class="form-group form-inline">
                        <div class="btn-group">
                            <!--onClick点击事件触发调用方法-->
                            <button type="button" class="btn btn-xs" style="background-color: #00BFFF;color:#FFFFFF">删除</button>
                        </div>
                        <div class="return">
                            <button type="button" class="btn" style="background-color:#00BFFF;color:#FFFFFF">返回随访组</button>
                        </div>
                        <form action="">
                            <input type="radio" name="check" value="checked">已选中
                            <input type="radio" name="check" value="unchecked">未选中
                        </form>
                    </div>
                </div>
            </div>
            <!--工具栏/-->
            <!--数据列表-->
            <table id="dataList" class="table table-bordered table-striped table-hover dataTable" style="background-color: #00BFFF;color:#FFFFFF">
                <thead>
                <tr>
                    <th class="sorting_asc"><input type="checkbox" id="fathercheck" onclick="fatherChecked()" name="fathercheck"/></th>
                    <th class="sorting_asc">门诊号/住院号</th>
                    <th class="sorting_asc">随访组</th>
                    <th class="sorting_asc">姓名</th>
                    <th class="sorting">性别</th>
                    <th class="sorting">年龄</th>
                    <th class="sorting">入组日期</th>
                    <th class="sorting">下次随访日期</th>
                    <th class="sorting">状态</th>
                    <th class="sorting">预览</th>
                    <th class="sorting">编辑信息</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="follow in pageUtil.result">
                    <td><input type="checkbox" id="childrencheck" onclick="childrenChecked()" ng-value="check.id" name="childrencheck"/></td>
                    <td ng-bind="follow.patientNumber"></td>
                    <td>{{follow.followGrowp}}</td>
                    <td>{{follow.name}}</td>
                    <td>{{follow.sex}}</td>
                    <td>{{follow.age}}</td>
                    <td>{{follow.date}}</td>
                    <td>{{follow.nextDate}}</td>
                    <td>{{follow.state}}</td>
                    <td>
                        <button type="button" ng-click="findOne()" class="btn bg-olive btn-xs" data-toggle="modal"data-target="#editModal1"style="background-color: #00BFFF;color:#FFFFFF">
                            查看
                        </button>
                    </td>
                    <td>
                        <button type="button" ng-click="findOne()" class="btn bg-olive btn-xs" data-toggle="modal"data-target="#editModal2"style="background-color: #00BFFF;color:#FFFFFF">
                            编辑
                        </button>
                    </td>
                </tr>
                </tbody>
            </table>
            <!--数据列表/-->
            <!--分页工具条展示-->
            <div>
                <button type="button" ng-click="pages(1)" class="btn btn-xs" style="background-color: #00BFFF;color:#FFFFFF">首页</button>
                <button type="button" ng-click="pages(pageUtil.prePage)" class="btn btn-xs" style="background-color: #00BFFF;color:#FFFFFF">上一页</button>

                <button type="button" ng-click="pages(pageUtil.nextPage)" class="btn btn-xs" style="background-color: #00BFFF;color:#FFFFFF">下一页</button>
                <button type="button" ng-click="pages(pageUtil.pages)" class="btn btn-xs" style="background-color: #00BFFF;color:#FFFFFF">尾页</button>
                <td>分页页数</td>
                <td>
                    <select id="pageSize" type="text" ng-click="pages()">
                        <option value="5">5</option>
                        <option value="10">10</option>
                        <option value="15">15</option>
                        <option value="20">20</option>
                    </select>
                </td>
                <td>转到</td>
                <td><input id="pagenum" type="text"style="width:42px;height:22.44px"; value="1" ng-click="pages()"/></td>
                <td><button type="button" ng-click="pages()"class="btn btn-xs" style="background-color: #00a7d0;color:#FFFFFF">GO!</button></td>
                <td>共{{pageUtil.total}}条数据</td>
            </div>
        </div>
        <!-- 数据表格 /-->
    </div>
</div>
</body>
</html>